@echo off
title Windows Garbage Cleanup Tool
echo ================================================
echo            Windows Garbage Cleanup Tool
echo ================================================
echo.

:: Prompt user for confirmation
echo This operation will clean system junk files. Administrator privileges may be required.
echo Continue? (Y/N)
set /p choice=
if /i not "%choice%"=="Y" (
    echo Operation canceled.
    pause
    exit
)

:: Check for administrator privileges
echo Checking for administrator privileges...
net session >nul 2>&1
if not %errorlevel%==0 (
    echo Administrator privileges are required. Please run this program as an administrator.
    pause
    exit
)

:: Clean %temp% folder
echo Cleaning system temporary folder %temp% ...
del /f /s /q "%temp%\*" >nul 2>&1
for /d %%i in ("%temp%\*") do rd /s /q "%%i"

:: Clean user temporary folder
echo Cleaning user temporary folder %USERPROFILE%\AppData\Local\Temp ...
del /f /s /q "%USERPROFILE%\AppData\
